home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / mail.748 < prev    next >
Text File  |  1992-02-06  |  12KB  |  285 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fswiss Helvetica;\f2\fmodern Courier;\f3\fmodern Ohlfs;}
  2. \paperw11440
  3. \paperh8320
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx540\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ul0\fs28 sendmail testing mail email sendmail.cf\
  8. \
  9. Q:    How can I check to see that Internet mail is correctly working?\
  10.  
  11. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320 \
  12.  
  13. \pard\tx540\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320 A:    Underneath the easy-to-use NeXTmail application lies the UNIX sendmail utility, which is both powerful and complicated.  To fully test mail operations you need a deep knowledge of how sendmail works along with networks, IPC, modems, and possibly uucp.  A reading list is appended to the end of this document.  Despite the complexity of the system, there are several easy tests you can do to insure that your mail configuration is working.  Here are several, along with some comments to help you learn what to look for.  Unless otherwise specified, all commands are to be run in a Terminal window.\
  14.  
  15. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320 \
  16.  
  17. \pard\tx720\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fi-720\li720\fc0 1. Checking the mailq.  This is by far the quickest test of mail.  In a shell window, type:\
  18.  
  19. \pard\tx720\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f1\fs24\fi-720\li720\fc0 \
  20.  
  21. \f2 myhost> 
  22. \b mailq
  23. \b0 \
  24.                 Mail Queue (2 requests)\
  25. --QID-- -Size- ----Q-Time----- ------------Sender/Recipient------------\
  26. AA00180     13 Sat Oct 27 08:50 ams\
  27.                Deferred: Name Server Failure for mail-gw.com\
  28.                                   norbates@batesh.com\
  29.                   \
  30.  
  31. \pard\tx0\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\fs28\fc0 This listing shows a single piece of mail that is currently stuck in the mail queue due to a Name Server Failure (other possibly helpful status messages can occur as well).  Sendmail will try again to deliver this message every hour (as specified in /etc/rc) for a default period of three days.  If the problem is not resolved by then, the mail will be returned to the sender.\
  32.  
  33. \pard\tx720\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-720\li720\fc0 \
  34. \
  35. 2. Try the unix command mail with the -v option in a shell window. 
  36. \f1\fs24 \
  37.  
  38. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320 \
  39.  
  40. \f2\b /usr/ucb/mail -v n_merit@nova32.com
  41. \f1\b0 \
  42. \
  43.  
  44. \f0\fs28 Try several different hosts and check the results.  It may be helpful for you to try a working host first so you know a correct transaction looks like.\
  45. \
  46.  
  47. \pard\tx720\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-700\li700 3. Run the SMTP 
  48. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320 (Simple Mail Transfer Protocol) 
  49. \pard\tx720\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-700\li700 mail transaction "by hand".\
  50.  
  51. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f1\fs24 \
  52.  
  53. \f2\b telnet destinationhost 25
  54. \f1\b0  \
  55.  
  56. \f2\b telnet destinationhost smtp\
  57. mconnect destinationhost\
  58. \
  59.  
  60. \b0 (these three commands are equivalent)
  61. \f1 \
  62. \
  63.  
  64. \f0\fs28 This is how sendmail sends mail over the internet--a so called "SMTP" transaction.  You can run the transaction by hand for testing purposes.  For example, this is how mail can get from the host source (source.com) to the destination endoline (endoline.bb.newtest.edu).  Mail shown is from userblob to norbates:
  65. \f1\fs24 \
  66. \
  67.  
  68. \f2\i\fc0 source>
  69. \i0  
  70. \b telnet endoline.bb.newtest.edu smtp
  71. \b0 \
  72.  
  73. \i Trying 333.2.22.11...\
  74. Connected to endoline.bb.newtest.edu.\
  75. Escape character is '^]'.
  76. \i0 \
  77. 220  endoline.bb.newtest.edu  Sendmail NeXT-1.0 (From Sendmail 5.52)/NeXT-1.0 ready at Wed, 3 Oct 90 17:39:05 CDT\
  78.  
  79. \b HELO source.com
  80. \b0     \
  81. 250  endoline.bb.newtest.edu  Hello source.com, pleased to meet you\
  82.  
  83. \b MAIL FROM:<userblob@source.com>
  84. \b0 \
  85. 250 <userblob@source.com>... Sender ok\
  86.  
  87. \b RCPT TO:<norbates>
  88. \b0 \
  89. 250 <norbates>... Recipient ok\
  90.  
  91. \b DATA
  92. \b0 \
  93. 354 Enter mail, end with "." on a line by itself\
  94.  
  95. \b Ignore this mail, it is a test (I am sending you a longer message)\
  96. .\
  97.  
  98. \b0 250 Mail accepted\
  99.  
  100. \b QUIT
  101. \b0 \
  102. 221  endoline.bb.newtest.edu  delivering mail\
  103. \
  104. Courier is text printed by endoline.bb.newtest.edu,\
  105.  
  106. \i Courier Oblique is text printed by source.com
  107. \i0 ,\
  108.  
  109. \b Courier Bold is text typed by the tester.
  110. \b0 \
  111. \
  112.  
  113. \f0\fs28 This is the easiest low level way to test connectivity to a remote mail site.  You are actually bypassing your local sendmail completely by doing this—enabling you to make sure your network is operating normally before you begin to tear up your sendmail.cf.\
  114. \
  115.  
  116. \pard\tx720\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-720\li720\fc0 4. Run sendmail in "address test mode".  Sendmail is a program responsible for transforming addresses and routing mail.\
  117.  
  118. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f1\fs24\fc0 \
  119.  
  120. \f2\b /usr/lib/sendmail -bt\
  121. \
  122.  
  123. \f0\b0\fs28 Address test mode allows you to check your sendmail.cf file.  A sample session runs like this:\
  124.  
  125. \f1\fs24 \
  126.  
  127. \f2\b /usr/lib/sendmail -bt
  128. \b0 \
  129. ADDRESS TEST MODE\
  130. Enter <ruleset> <address>\
  131. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\b\fc0 0 norbates@batesh.com (Norman Bates)\
  132.  
  133. \b0 rewrite: ruleset  3   input: "norbates" "@" "batesh" "." "com"\
  134. rewrite: ruleset  6   input: "norbates" "<" "@" "batesh" "." "com" ">"\
  135. rewrite: ruleset  6 returns: "norbates" "<" "@" "batesh" "." "com" ">"\
  136. rewrite: ruleset  3 returns: "norbates" "<" "@" "batesh" "." "com" ">"\
  137. rewrite: ruleset  0   input: "norbates" "<" "@" "batesh" "." "com" ">"\
  138. rewrite: ruleset  9   input: "norbates" "<" "@" "batesh" "." "com" ">"\
  139. rewrite: ruleset  9 returns: "norbates" "<" "@" "batesh" "." "com" ">"\
  140. rewrite: ruleset  0 returns: "^V" "etherl" "^W" "mail-gw" "." "gov" "^X" "norbates" "<" "@" "batesh" "." "com" ">"
  141. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 \
  142. > \
  143.  
  144. \f1 \
  145.  
  146. \f0\fs28 In this example you are testing rule set 0, the base rewriting rule (all to: addresses are run through this rule).  The final result depicted above translated into english:\
  147.  
  148. \f1\fs24 \
  149.  
  150. \f2 Argument separator    "^V"\
  151. Mailer                "etherl"\
  152. Argument separator    "^W"\
  153. Hostname            "mail-gw" "." "gov"\
  154. Argument separator    "^X"\
  155. TO field            "norbates" "<" "@" "batesh" "." "com" ">"
  156. \f1 \
  157. \
  158.  
  159. \f0\fs28 Sendmail in order to send to norbates@batesh.com (Norman Bates), will use the etherl mailer, will forward to mail-gw.gov (instead of going directly), and it will put norbates<@batesh.com> in the "to" field.  Mail-gw.gov' s sendmail will then rewrite the address again before sending it to you.\
  160. \
  161.  
  162. \pard\tx720\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-720\li720\fc0 5. Return Receipt.  Return receipt is a feature that instructs the final destination host to send a short message (describing the path of the mail) back to the address specified.  You may specify this service by placing the following in top of a mail file (you will need to construct this by hand using a text editor).\
  163.  
  164. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f1\fs24\fc0 \
  165.  
  166. \f2\b Return-Receipt-To: your_address
  167. \f1\b0 \
  168. \
  169.  
  170. \f0\fs28 If you place the following in a valid mail file and run sendmail by hand, you should get a receipt when the final delivery machine receives the mail you are sending.  Here is an example:\
  171.  
  172. \f1\fs24 \
  173.  
  174. \f2 % 
  175. \b cat /tmp/testmail
  176. \b0 \
  177. From: abc@cbs.com\
  178. Return-Receipt-To: abc@cbs.com\
  179. Subject: testing your sendmail.cf\
  180. One last test message for you to ignore (this will become clear shortly)\
  181.  
  182. \f1 % 
  183. \f2\b /usr/lib/sendmail -v "norbates@batesh.com (Norman Bates)" < /tmp/testmail
  184. \b0  \
  185. norbates@batesh.com (Norman Bates)... Connecting to cbs.com via etherl...\
  186. Trying 192.72.1.11...  connected.\
  187. 220 batesh.com Sendmail NeXT-1.0 (From Sendmail 5.52)/NeXT0.0-Aleph ready at Wed, 3 Oct 90 16:30:17 PDT\
  188. >>> HELO cbs.com\
  189. 250 batesh.com Hello cbs.com, pleased to meet you\
  190. >>> MAIL From:<abc@cbs.com>\
  191. 250 <abc@cbs.com>... Sender ok\
  192. >>> RCPT To:<norbates@batesh.com>\
  193. 250 <norbates@batesh.com>... Recipient ok\
  194. >>> DATA\
  195. 354 Enter mail, end with "." on a line by itself\
  196. >>> .\
  197. 250 Mail accepted\
  198. >>> QUIT\
  199. 221 batesh.com delivering mail\
  200. norbates@batesh.com (Norman Bates)... Sent\
  201.  
  202. \f1 \
  203.  
  204. \f0\fs28 Sometime later, abc@cbs.com will receive a short note from the sendmail running on batesh.com confirming receipt.\
  205. \
  206.  
  207. \pard\tx720\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fi-720\li720\fc0 6. nslookup†.  If you use BIND (the Internet Domain Lookup service) to resolve hostnames or you have access to an internet nameserver, the following command may be helpful to you in testing:\
  208.  
  209. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f1\fs24\fc0 \
  210.  
  211. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f2\fc0 localhost> 
  212. \b nslookup
  213. \b0 \
  214.                   \
  215.  
  216. \f0\fs28 This command is most useful for checking to see what host actually receives mail for the address you are using.  It is possible that the mail exchanger for a given address is an entirely separate host from the one you thought you were connecting to.\
  217. \
  218.  
  219. \pard\tx720\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fi-720\li720\fc0 7. Netmailsites database.\
  220. \
  221.  
  222. \fi0\li0 Your mail system may be functioning perfectly but someone may have given you an incorrect address or the host associated with that address was disconnected.  You may not even have a telephone number or postal address for the person you wish to reach.  If you have access to the Internet or the Merit Computer Network, you may be able to get the host names of currently active hosts by using the Netmailsites database, a public service of the Merit Computer Network and The University of Michigan Computing Center.\
  223. \
  224. From the internet, you may connect to the Merit Computer Network as follows:\
  225.  
  226. \f1\fs24 \
  227.  
  228. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f2\b\fc0 telnet hermes.merit.edu
  229. \b0 \
  230. Trying 35.1.1.60...\
  231. Connected to hermes.merit.edu.\
  232. Escape character is '^]'.\
  233. \
  234. %Merit:Hermes (CCB9A4:TN06:VT100:EDIT=MTS)\
  235. \
  236. Which Host?
  237. \b netmailsites
  238. \b0 \
  239. \
  240.                 ****  Merit Net Mail Sites Database  ****\
  241. \
  242.  At the prompt, enter the name or partial name of an institution,\
  243.  place, or computer.  Type HELP for assistance.\
  244. \
  245.  You may issue up to three queries.\
  246. \
  247. \
  248.  Press <RETURN> to stop, 3 remaining queries.\
  249. :Enter the name of a site   -> bates  \
  250. \
  251.  There is one site found for BATES\
  252. \
  253. \
  254. Bitnet Sites:\
  255.   BATESH                   Bates Hotel\
  256. \
  257.  Type HELP ADDRESS for information on how to use a mail site name.\
  258. \
  259.  
  260. \f1 \
  261.  
  262. \f0\fs28 Netmailsites is a public MTS server built on a SPIRES database that contains over 13,000 host sites derived from uucp routing maps, Bitnet, CERN, and SRI-NIC.  It is updated regularly and may be extremely helpful in finding the correct spelling of hosts names, searching for mail hosts by site name, etc.\
  263. \
  264. Reading list:\
  265. THAT sendmail.cf FILE I, Robert Kolstad, Unix Review Volume 8 #1.\
  266. THAT sendmail.cf FILE II, Robert Kolstad, Unix Review Volume 8 #2.\
  267. SENDMAIL -- An Internetwork Mail Router, Eric Allman.\
  268. SENDMAIL INSTALLATION AND OPERATIONS GUIDE,  Eric Allman.\
  269. sendmail (8) man page.\
  270.  
  271. \f1\fs24 \
  272.  
  273. \f0 † Indicates a feature only available in the 2.0 release\
  274.  
  275. \f1 \
  276.  
  277. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28\fc0 Valid for 2.0\
  278.  
  279. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f1\fs24\fc0 \
  280.  
  281. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28 QA748\
  282. \
  283.  
  284.